<!DOCTYPE html>
<html lang="ch">
<head>
	<meta charset="utf8">
	<title>微信公众号线索提交</title>
</head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<style type="text/css">
	.form-div{
		padding: 0;
		width:800px;
		margin:30px auto;
		
	}
	.form-div>.form-item{
		width:800px;
		height: 40px;
		margin:10px;
		
	}
	.form-div>.form-item>div{
		width:80px;
		height: 30px;
		margin:0;
		float: left;
		line-height: 40px;
	}
	.form-div>.form-item>input[type=text]{
		padding: 0;
		margin:0;
		outline: none;
		background-color: transparent;
		border: none;
		width:515px;
		height: 40px;
		line-height: 40px;
		float: left;
		border:1px solid #aaa;
		padding-left:5px;

	}
	.form-div>.form-item>input[type=text]:focus{

		border:1px solid #e4393c;
	}
	.btn{
		border:none;
		background-color: none;
		margin:0;
		outline: none;
		width:80px;
		height: 35px;
		background-color: #e4393c;
		color:#fff;
		font-size: 15px;
		letter-spacing: 5px;

	}
</style>
<body>
	
	<form class="form-div" method="post" action="#">
		<div><h2>线索提交</h2></div>
		<div class="form-item">
			<div>微信名称：</div><input type="text" name="wxName" autocomplete="off" required="required">
		</div>

		<div class="form-item">
			<div>客户姓名：</div><input type="text" name="chengHu" autocomplete="off" required="required">
		</div>
		<div class="form-item">
			<div>手机号：</div><input  pattern=[0-9]{11} type="text" name="phone" autocomplete="off" required="required">
		</div>

		<div class="clear"></div>

		<div class="form-item">
			<div>备注:</div>
			<input type="text" name="remark" autocomplete="off" required="required">
		</div>
		<div class="form-item">
			<input type="text" name="type" value="4" style="display: none" >
			<input class="btn" type="submit" name="" value="提交">
			<input class="btn" type="reset" name="" value="重置">
		</div>
	</form>
</body>
<script type="text/javascript">
	
	$(function(){

		$('form').submit(function(e){

			$.ajax({

				url:'ttapi.php',
				method:'post',
				data:$('form').serialize(),
				success:function(data){
					console.log(data)
					alert(JSON.parse(data).msg)
				}

			})

			$('form')[0].reset();

			return false
		})


	})

</script>
</html>
